<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.core.voc_sim.VMPilot</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.core-module.html">Package&nbsp;core</a> ::
        <a href="simvoc.core.voc_sim-module.html">Module&nbsp;voc_sim</a> ::
        Class&nbsp;VMPilot
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class VMPilot</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_simvoc_c_57" name="uml_class_diagram_for_simvoc_c_57">
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="17,324,532,343"/>
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#signal" title="Callback method invoked by job_model.PilotJob to receive notification of &#160;job start, orderly external termination, and disorderly external &#160;termination (kill)." alt="" coords="17,343,532,361"/>
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#run" title="Initiates the FileCache request for the VM image file, so that the boot &#160;process may proceed." alt="" coords="17,361,532,380"/>
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#stop" title="Terminates a running VM or short&#45;circuits the boot process, if no VM is &#160;currently running." alt="" coords="17,380,532,399"/>
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#boot_vm" title="Callback method invoked by the site file cache (storage.FileCache) object &#160;when the VM image file is ready." alt="" coords="17,399,532,417"/>
<area shape="rect" id="node134" href="simvoc.core.voc_sim.VMPilot-class.html#vm_state_callback" title="Callback method invoked by the associated VirtualMachine instance whenever &#160;the machine state changes." alt="" coords="17,417,532,436"/>
<area shape="rect" id="node1" href="simvoc.core.voc_sim.VMPilot-class.html" title="Pilot job for leasing physical machines to run virtual machines." alt="" coords="5,291,544,442"/>
<area shape="rect" id="node135" href="simvoc.core.job_model.PilotJob-class.html#start" title="Starts a pilot job." alt="" coords="193,191,356,209"/>
<area shape="rect" id="node135" href="simvoc.core.job_model.PilotJob-class.html#notify_done" title="Simulator&#45;aware method used by the external process (the one utilizing the &#160;pilot job to lease resources) to notify the pilot job to end" alt="" coords="193,209,356,228"/>
<area shape="rect" id="node135" href="simvoc.core.job_model.PilotJob-class.html#terminate" title="Notifies the external process (callback function) that the pilot job is &#160;being terminated (provided the job has started), then submits an event to &#160;terminate the pilot job immediately." alt="" coords="193,228,356,247"/>
<area shape="rect" id="node135" href="simvoc.core.job_model.PilotJob-class.html#kill" title="Kills the pilot job, notifying the external process (callback function) of &#160;the kill, if it is running." alt="" coords="193,247,356,265"/>
<area shape="rect" id="node2" href="simvoc.core.job_model.PilotJob-class.html" title="A pilot job is a job that is submitted to the grid for the purpose of leasing a remote resource." alt="" coords="181,158,368,271"/>
<area shape="rect" id="node136" href="simvoc.core.job_model.Job-class.html#submit" title="Method called by the scheduler when submitting a job." alt="" coords="188,39,361,57"/>
<area shape="rect" id="node136" href="simvoc.core.job_model.Job-class.html#set_finish" title="Sets or updates the time at which the job will finish." alt="" coords="188,57,361,76"/>
<area shape="rect" id="node136" href="simvoc.core.job_model.Job-class.html#finish" title="Simulator&#45;aware method that is called at job completion time by an event &#160;set by the start() method." alt="" coords="188,76,361,95"/>
<area shape="rect" id="node136" href="simvoc.core.job_model.Job-class.html#__str__" title="str(x)" alt="" coords="188,95,361,113"/>
<area shape="rect" id="node136" href="simvoc.core.job_model.Job-class.html#__repr__" title="repr(x)" alt="" coords="188,113,361,132"/>
<area shape="rect" id="node3" href="simvoc.core.job_model.Job-class.html" title="Simulated representation of a regular job, which represents a workload submitted by the user to run on a remote system." alt="" coords="176,6,373,138"/>
</map>
  <img src="uml_class_diagram_for_simvoc_c_57.gif" alt='' usemap="#uml_class_diagram_for_simvoc_c_57" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Pilot job for leasing physical machines to run virtual machines. Upon 
  starting execution on a host, this job will first request the VM image 
  file from the local file cache registered as a brokered resource with the
  site job scheduler. If the file cache and file are available, then the 
  image file will be transferred from a server (if necessary) and made 
  available via an asynchronous callback. Once the file is available, the 
  virtual machine instance will be booted by requesting the &quot;vmm&quot;
  capability of the host machine and issuing a start request. The VM then 
  boots and joins an overlay scheduler configured in the VM image.</p>
  <p>The simulator is capable of simulating several possible error 
  conditions that could arise in the above procedure. It is possible that 
  the file cache resource will not be available from the site. It is also 
  possible that the host machine receiving the job will not have a 
  &quot;vmm&quot; capability. Either of these cases will result in pilot 
  job termination with an error condition.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">img_name</span>,
        <span class="summary-sig-arg">img_src</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">pr_err</span>=<span class="summary-sig-default">0.0</span>,
        <span class="summary-sig-arg">voc_callback</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">**kwds</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#signal" class="summary-sig-name">signal</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">sim</span>,
        <span class="summary-sig-arg">sched</span>,
        <span class="summary-sig-arg">node</span>,
        <span class="summary-sig-arg">signum</span>)</span><br />
      Callback method invoked by job_model.PilotJob to receive notification
      of job start, orderly external termination, and disorderly external 
      termination (kill).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.signal">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#run" class="summary-sig-name">run</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">sim</span>,
        <span class="summary-sig-arg">sched</span>)</span><br />
      Initiates the FileCache request for the VM image file, so that the 
      boot process may proceed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.run">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#stop" class="summary-sig-name">stop</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">signum</span>)</span><br />
      Terminates a running VM or short-circuits the boot process, if no VM 
      is currently running.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.stop">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#boot_vm" class="summary-sig-name">boot_vm</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>,
        <span class="summary-sig-arg">img_name</span>,
        <span class="summary-sig-arg">image</span>)</span><br />
      Callback method invoked by the site file cache (storage.FileCache) 
      object when the VM image file is ready.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.boot_vm">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.voc_sim.VMPilot-class.html#vm_state_callback" class="summary-sig-name">vm_state_callback</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">sched</span>,
        <span class="summary-sig-arg">state</span>)</span><br />
      Callback method invoked by the associated VirtualMachine instance 
      whenever the machine state changes.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.vm_state_callback">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.Job-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      repr(x)
      <em>(Inherited from <a href="simvoc.core.job_model.Job-class.html">simvoc.core.job_model.Job</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#Job.__repr__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.Job-class.html#__str__" class="summary-sig-name">__str__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      str(x)
      <em>(Inherited from <a href="simvoc.core.job_model.Job-class.html">simvoc.core.job_model.Job</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#Job.__str__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.Job-class.html#finish" class="summary-sig-name">finish</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Simulator-aware method that is called at job completion time by an 
      event set by the start() method.
      <em>(Inherited from <a href="simvoc.core.job_model.Job-class.html">simvoc.core.job_model.Job</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#Job.finish">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.PilotJob-class.html#kill" class="summary-sig-name">kill</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Kills the pilot job, notifying the external process (callback 
      function) of the kill, if it is running.
      <em>(Inherited from <a href="simvoc.core.job_model.PilotJob-class.html">simvoc.core.job_model.PilotJob</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#PilotJob.kill">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.PilotJob-class.html#notify_done" class="summary-sig-name">notify_done</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">sim</span>)</span><br />
      Simulator-aware method used by the external process (the one 
      utilizing the pilot job to lease resources) to notify the pilot job 
      to end
      <em>(Inherited from <a href="simvoc.core.job_model.PilotJob-class.html">simvoc.core.job_model.PilotJob</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#PilotJob.notify_done">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.Job-class.html#set_finish" class="summary-sig-name">set_finish</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">when</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Sets or updates the time at which the job will finish.
      <em>(Inherited from <a href="simvoc.core.job_model.Job-class.html">simvoc.core.job_model.Job</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#Job.set_finish">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.JobStartResult-class.html" 
      class="link">results.JobStartResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.PilotJob-class.html#start" class="summary-sig-name">start</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">sim</span>,
        <span class="summary-sig-arg">node</span>)</span><br />
      Starts a pilot job.
      <em>(Inherited from <a href="simvoc.core.job_model.PilotJob-class.html">simvoc.core.job_model.PilotJob</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#PilotJob.start">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.JobSubmitResult-class.html" 
      class="link">results.JobSubmitResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.Job-class.html#submit" class="summary-sig-name">submit</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">sched</span>)</span><br />
      Method called by the scheduler when submitting a job.
      <em>(Inherited from <a href="simvoc.core.job_model.Job-class.html">simvoc.core.job_model.Job</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#Job.submit">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.job_model.PilotJob-class.html#terminate" class="summary-sig-name">terminate</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">signum</span>=<span class="summary-sig-default">15</span>)</span><br />
      Notifies the external process (callback function) that the pilot job 
      is being terminated (provided the job has started), then submits an 
      event to terminate the pilot job immediately.
      <em>(Inherited from <a href="simvoc.core.job_model.PilotJob-class.html">simvoc.core.job_model.PilotJob</a>)</em></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.job_model-pysrc.html#PilotJob.terminate">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>,
        <span class="sig-arg">img_name</span>,
        <span class="sig-arg">img_src</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">pr_err</span>=<span class="sig-default">0.0</span>,
        <span class="sig-arg">voc_callback</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">**kwds</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> (str) - Name of the pilot job</li>
        <li><strong class="pname"><code>img_name</code></strong> (str) - Name of the VM image to use</li>
        <li><strong class="pname"><code>img_src</code></strong> - Reference to a FileStore containing the VM image</li>
        <li><strong class="pname"><code>pr_err</code></strong> (float) - Probability of a random error in the pilot job (0.0-1.0)</li>
        <li><strong class="pname"><code>voc_callback</code></strong> - Callback function to invoke for VOC management purposes. This 
          function will receive two arguments: a reference to the VM 
          instance created by the pilot job, and a state change code 
          (&quot;SC_&quot; prefixed constants in core_common). This 
          function will be called only after the VM has booted.</li>
        <li><strong class="pname"><code>kwds</code></strong> - Pilot job extra data. If the extra data contains a keyword 
          argument &quot;classAds&quot;, then an additional classAd will be
          added to the classAds value passed into this method: {'IS_METAL':
          'TRUE'}</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="signal"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">signal</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">sim</span>,
        <span class="sig-arg">sched</span>,
        <span class="sig-arg">node</span>,
        <span class="sig-arg">signum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.signal">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Callback method invoked by job_model.PilotJob to receive notification 
  of job start, orderly external termination, and disorderly external 
  termination (kill).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - A reference to this pilot job</li>
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>sim</code></strong> - A reference to the simulator object</li>
        <li><strong class="pname"><code>sched</code></strong> - Scheduler used to start this job</li>
        <li><strong class="pname"><code>node</code></strong> - Worker node on which this job is running</li>
        <li><strong class="pname"><code>signum</code></strong> (int) - Signal number to be received by the pilot job. See the <a 
          href="simvoc.core.core_common-module.html" 
          class="link">core_common</a> constants with the &quot;PJ_&quot; 
          prefix, along with the <a 
          href="simvoc.core.job_model.PilotJob-class.html" 
          class="link">job_model.PilotJob</a> documentation.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a simulator results collection</dd>
  </dl>
</td></tr></table>
</div>
<a name="run"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">run</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">sim</span>,
        <span class="sig-arg">sched</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.run">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Initiates the FileCache request for the VM image file, so that the 
  boot process may proceed.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>sim</code></strong> - Reference to the simulator object</li>
        <li><strong class="pname"><code>sched</code></strong> - Reference to the scheduler starting this job</li>
    </ul></dd>
    <dt>Returns: <a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></dt>
  </dl>
</td></tr></table>
</div>
<a name="stop"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">stop</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">signum</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.stop">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Terminates a running VM or short-circuits the boot process, if no VM 
  is currently running.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>signum</code></strong> (int) - Termination signal number (use the constants with the 
          &quot;PJ_&quot; prefix in <a 
          href="simvoc.core.core_common-module.html" 
          class="link">core_common</a>)</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a VMPilotResult if the job is running, or None of the pilot job 
          itself has not yet started</dd>
  </dl>
</td></tr></table>
</div>
<a name="boot_vm"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">boot_vm</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">simobj</span>,
        <span class="sig-arg">img_name</span>,
        <span class="sig-arg">image</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.boot_vm">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Callback method invoked by the site file cache (storage.FileCache) 
  object when the VM image file is ready. This method boots the VM 
  instance.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
        <li><strong class="pname"><code>img_name</code></strong> (str) - VM image name</li>
        <li><strong class="pname"><code>image</code></strong> - Reference to the VM image file object</li>
    </ul></dd>
    <dt>Returns: <a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></dt>
  </dl>
</td></tr></table>
</div>
<a name="vm_state_callback"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">vm_state_callback</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">sched</span>,
        <span class="sig-arg">state</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.voc_sim-pysrc.html#VMPilot.vm_state_callback">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Callback method invoked by the associated VirtualMachine instance 
  whenever the machine state changes. If the state change SC_SHUTDOWN is 
  received, then this method will invoke the notify_done() method of this 
  object.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>sched</code></strong> - Scheduler used to run this job</li>
        <li><strong class="pname"><code>state</code></strong> (int) - New machine state (see constants in the <a 
          href="simvoc.core.core_common-module.html" 
          class="link">core_common</a> module with the &quot;SC_&quot; 
          prefix)</li>
    </ul></dd>
    <dt>Returns: <a href="simvoc.core.results.VMPilotResult-class.html" 
      class="link">results.VMPilotResult</a></dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:34 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
